<?php

namespace app\controller;

use app\BaseController;
use think\Response;

class Website extends BaseController
{
    /**
     * 网站配置
     *
     * @return Response
     */
    public function index(): Response
    {
        $data = [
            'title'        => '网站标题',
            'keywords'     => '网站关键字',
            'description'  => '网站描述',
            'website_name' => 'juliang.com',
            'copyright'    => 'Copyright © 版权所有 湖北巨量云科技有限公司',
            'icp'          => '鄂ICP备2021012394号',
            'beian'        => '鄂公网安备 42018502005364号',
            'logo'         => 'logo',
            'favicon'      => 'favicon',
            'isp'          => '《中华人民共和国增值电信业务经营许可证》ISP/IDC:B1-20213562',
            'xukezheng'    => '互联网虚拟专用网业务许可证:B1-20213562',
            'dengjihao'    => '本模板版权局已登记·盗版必究，登记号：黔作登字-2021-F-00331209',
            'dianhua'      => '400-888-8888',
            'email'        => 'admin@juliang.com',
            'qq'           => '123456789',
            'work_time'    => '8:30 - 18:00',
            'address'      => '湖北省武汉市武昌区',
        
        ];
        return $this->success( 'success', $data );
    }
    
    /**
     * 获取底部信息
     *
     * @return Response
     */
    public function getFooterList(): Response
    {
        $data = [
            [
                'title' => '产品服务',
                'path'  => '/product',
                'list'  => [
                    [ 'title' => '产品1', 'path' => '/product/1', ],
                    [ 'title' => '产品2', 'path' => '/product/2', ],
                    [ 'title' => '产品3', 'path' => '/product/3', ],
                ],
            ],
            [
                'title' => '帮助中心',
                'path'  => '/help',
                'list'  => [
                    [ 'title' => '文档中心', 'path' => '/help/article', ],
                    [ 'title' => '常见问题', 'path' => '/help/question', ],
                ],
            ],
            [
                'title' => '关于我们',
                'path'  => '/about',
                'list'  => [
                    [ 'title' => '公司简介', 'path' => '/about/1', ],
                    [ 'title' => '发展历程', 'path' => '/about/2', ],
                    [ 'title' => '团队介绍', 'path' => '/about/3', ],
                ],
            ],
        ];
        return $this->success( 'success', $data );
    }
    
    /**
     * 文章详情
     *
     * @return Response
     */
    public function article(): Response
    {
        $data = [
            'title'         => '文章标题0',
            'content'       => '<div style="color: aquamarine;font-size: 24px;">文章内容0</div>',
            'author'        => '文章作者0',
            'create_time'   => '文章创建时间',
            'update_time'   => '文章更新时间',
            'view_count'    => '文章浏览量',
            'comment_count' => '文章评论量',
            'like_count'    => '文章点赞量',
            'share_count'   => '文章分享量',
            'tag'           => '文章标签',
            'category'      => '文章分类',
        ];
        return $this->success( 'success', $data );
    }
    
    /**
     * 文章列表
     *
     * @return Response
     */
    public function articleList(): Response
    {
        $data = [
            [
                'title'         => '文章标题1',
                'content'       => '文章内容1',
                'author'        => '文章作者1',
                'create_time'   => '文章创建时间',
                'update_time'   => '文章更新时间',
                'view_count'    => '文章浏览量',
                'comment_count' => '文章评论量',
                'like_count'    => '文章点赞量',
                'share_count'   => '文章分享量',
            ],
            [
                'title'         => '文章标题2',
                'content'       => '文章内容2',
                'author'        => '文章作者2',
                'create_time'   => '文章创建时间',
                'update_time'   => '文章更新时间',
                'view_count'    => '文章浏览量',
                'comment_count' => '文章评论量',
                'like_count'    => '文章点赞量',
                'share_count'   => '文章分享量',
            ],
        ];
        return $this->success( 'success', $data );
    }
    
    /**
     * 评论列表
     *
     * @return Response
     */
    public function commentList(): Response
    {
        $data = [
            [
                'id' => 1,
                'avatar' => '头像1',
                'nickname' => '昵称1',
                'content' => '评论内容1',
                'create_time' => '1小时前',
                'like_count' => 50,
                'dislike_count' => 2,
                'reply_list' => [
                    [
                        'id' => 3,
                        'avatar' => '头像1',
                        'nickname' => '昵称1',
                        'content' => '回复内容1',
                        'create_time' => '1小时前',
                        'like_count' => 50,
                        'dislike_count' => 1,
                    ],
                    [
                        'id' => 4,
                        'avatar' => '头像2',
                        'nickname' => '昵称2',
                        'content' => '回复内容2',
                        'create_time' => '2小时前',
                        'like_count' => 100,
                        'dislike_count' => 0,
                    ]
                ],
            ],
            [
                'id' => 2,
                'avatar' => '头像2',
                'nickname' => '昵称2',
                'content' => '评论内容2',
                'create_time' => '3天前',
                'like_count' => 200,
                'dislike_count' => 1,
                'reply_list' => [],
            ],
        ];
        return $this->success( 'success', $data );
    }
}